package com.flyqiu.flow.api.deploy;

import com.alibaba.fastjson2.JSONObject;
import com.flyqiu.flow.model.entity.ProcDeployDef;
import com.flyqiu.flow.model.entity.ProcDeploySource;

/**
 * 流程发布
 */
public interface IFlowDeploy {

    /**
     * 流程部署唯一标识
     *
     * @return
     */
    String procDeployKey();

    /**
     * 流程部署器名称
     *
     * @return
     */
    default String procDeployName() {
        return procDeployKey();
    }

    /**
     * 部署流程模型
     *
     * @param modelSource
     * @param procDefKey
     * @param procName
     * @param category
     * @return
     */
    ProcDeploySource deploy(JSONObject modelSource, String procDefKey, String procName, String category);

    /**
     * 删除发布模型资源信息
     *
     */
    void deleteDeploy(ProcDeployDef procDeployDef);

    /**
     * 根据发布id
     *
     * @param deploySourceId
     * @return
     */
    JSONObject getModelSource(String deploySourceId);


}
